This function ornaments a symbol pattern by creating a upward moving appoggiatura from a lower symbol where two or more symbols repeat. Use it to smooth melodies with too many repeated symbols. Note that this works only with symbol patterns containing non-transpose symbols.
(ornament-lower 1 '(a a a a c c -l -l -l k l m m))
--> (-b -b -b a b c -m -m -l k l l m)
(ornament-lower 2 '(a a a a c c -l -l -l k l m m))
--> (-c -c -b a b c -n -m -l k k l m)
(ornament-lower 3 '(a a a a c c -l -l -l k l m m))